package com.ss.ttm.net;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public final class AVNetwork {
    public static final int IS_MOBILE_NETWORK = 2;
    public static final int IS_UNKOWN_NETWORK = 0;
    public static final int IS_WIFF_NETWORK = 1;

    public AVNetwork() {

    }

    public static final int getNetworkType(Context arg3) {
        int v0_2;
        try {
            NetworkInfo v0_1 = ((ConnectivityManager) arg3.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
            if (v0_1 == null) {
                v0_2 = 0;
                return v0_2;
            }

            v0_2 = v0_1.getType();
            if (v0_2 != 1) {
                if (v0_2 == 0) {
                    return 2;
                } else {
                    return 0;
                }
            }
        } catch (Throwable v0) {
            return 0;
        }
        return 1;
    }
}

